<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>判断是否是闰年</title>
</head>
<body>
    <script>
        function feb(){
            var year = prompt('请输入一个年份：');
            if(leapyear(year)){
                alert('当前年份是闰年');
            }else{
                alert('当前年份是平年');
            }
        }feb();
        function leapyear(year1){
            var  flag = false;
            if(year1 % 4 ==0 && year1 % 100!=0 || year1 %400 == 0){
                flag =true;
            }
            return flag;

        }
    </script>
</body>
</html>